﻿using System.Security.Principal;

namespace SmartHRMS.Services
{
    /// <summary>
    /// Anonymous Identity implements IIdentity interface.
    /// </summary>
    internal class AnonymousIdentity : IIdentity
    {
        /// <summary>
        /// Construct AnonymousIdentity by user name
        /// </summary>
        /// <param name="userName"></param>
        internal AnonymousIdentity(string userName)
            : this(userName, "")
        {
        }

        /// <summary>
        /// Construct AnonymousIdentity by user name and authentication type.
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="authenticationType"></param>
        internal AnonymousIdentity(string userName, string authenticationType)
        {
            this.Name = userName;
            this.AuthenticationType = authenticationType;
        }

        /// <summary>
        /// Gets authentication type
        /// </summary>
        public string AuthenticationType { get; private set; }

        /// <summary>
        /// Gets false always since this is anonymous identity.
        /// </summary>
        public bool IsAuthenticated { get { return false; } }

        /// <summary>
        /// Gets the authenticated user name.
        /// </summary>
        public string Name { get; private set; }
    }
}